#pragma once
#include <BWAPI.h>
#include <BWTA.h>
#include <windows.h>
#include <Arbitrator.h>
#include <WorkerManager.h>
#include <SupplyManager.h>
#include <BuildManager.h>
#include <BuildOrderManager.h>
#include <TechManager.h>
#include <UpgradeManager.h>
#include <BaseManager.h>
#include <ScoutManager.h>
#include <DefenseManager.h>
#include <BorderManager.h>
#include <InformationManager.h>
#include <UnitGroupManager.h>
#include "EnhancedUI.h"
#include "CFormation.h"

#include "HarassmentManager.h"

#include <ProductionManager.h>
#include <BuildingPlacer.h>

static bool analyzed;
static bool analysis_just_finished;
DWORD WINAPI AnalyzeThread();

class ExampleAIModule : public BWAPI::AIModule
{
public:
	virtual void onStart();
	virtual void onEnd(bool isWinner);
	virtual void onFrame();
	virtual bool onSendText(std::string text);
	virtual void onPlayerLeft(BWAPI::Player* player);
	virtual void onNukeDetect(BWAPI::Position target);
	virtual void onUnitCreate(BWAPI::Unit* unit);
	virtual void onUnitDestroy(BWAPI::Unit* unit);
	virtual void onUnitMorph(BWAPI::Unit* unit);
	virtual void onUnitShow(BWAPI::Unit* unit);
	virtual void onUnitHide(BWAPI::Unit* unit);
	virtual void onUnitRenegade(BWAPI::Unit* unit);

	bool aiCommands(std::string text);

	std::map<BWAPI::Unit*,BWAPI::UnitType> buildings;
	Arbitrator::Arbitrator<BWAPI::Unit*,double> arbitrator;
	WorkerManager* workerManager;
	SupplyManager* supplyManager;
	BuildManager* buildManager;
	BorderManager* borderManager;
	TechManager* techManager;
	UpgradeManager* upgradeManager;
	BaseManager* baseManager;
	ScoutManager* scoutManager;
	BuildOrderManager* buildOrderManager;
	DefenseManager* defenseManager;
	InformationManager* informationManager;
	UnitGroupManager* unitGroupManager;
	EnhancedUI* enhancedUI;

	HarassmentManager* harassmentManager;
};
